<form class="app_form" method="post" action="<?php echo $this->baseurl("/admin/config/$section")?>">
<?php echo $this->callElement("default/tools/tool_bar",array("buttons"=>array(array("type"=>"save"),array('type'=>'file_manager'),array("type"=>"back")) ,"title" => $definition['base']['title'])); ?>
    <?php foreach($definition['groups'] as $selection_key => $selection): ?>
        <div class="app_box " id="accordion" >
            <h3 class="app_box_title toggler"><span class="box-button"> </span> <?php echo $selection['title'];?></h3>
            <div class="box-body element">
                <?php
					$Grid=App::Module('DataGrid')->Clear()->setDisplay('FormListing');
                    foreach ( $selection['selection'] as $soption_key => $soption ) :
                        $value = $this->get_config($soption_key);
                        $value = isset($value) ? $value : $soption['default'] ;
                        switch( $soption['type'])
                        {
                            case "passwordTag"  :
													$Grid->addRow($soption['title'], App::load("Helper/Html")->passwordTag("data[sconfig][{$soption_key}]",$value,array("class"=>"app_input")));			                
                                                    break;
                            case "selectTag"    :
													$Grid->addRow($soption['title'],App::load("Helper/Html")->selectTag("data[sconfig][{$soption_key}]",$soption['options'],$value));
                                                    break;
                            default             :
													$Grid->addRow($soption['title'], App::load("Helper/Html")->inputTag("data[sconfig][{$soption_key}]",$value,array("class"=>"app_input")));
                                                    break;
                        }
                    endforeach;
					$Grid->render();
                ?>
            </div>
        </div>
    <?php endforeach; ?>	
<?php echo $this->callElement("default/tools/tool_bar",array("buttons"=>array(array("type"=>"save"),array("type"=>"back")) ,"position" => 'bottom'));?>
</form>

<?php   if( $this->get_config('disable_accordion') != 'Yes') : ?>
<script type="text/javascript">
   var myAccordion = new Accordion($('accordion'), 'h3.toggler', 'div.element', {
		opacity: false,
		onActive: function(toggler, element){
			toggler.setStyle('color', '#FFFFFF');
		},
		onBackground: function(toggler, element){
			toggler.setStyle('color', '#FFFFFF');
		}
	});
</script>
<?php endif; ?>